<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
	$(function() {
		//$('#inputForm input').tooltip({'placement':'top'});
		$('#addNodeForm input').tooltip();
		//表单验证
		$('#addNodeForm').checkForm();
		$('#addNodeForm').ajaxForm({
			url : _ctx + "/registry/update_data_category.do",
			type : "post",
			dataType : "json",
			beforeSubmit : function() {
				$("#sbmBtn").attr("disabled", "disabled");
			},
			clearForm : false,
			resetForm : false,
			success : function(resp) {
				if (resp.status == '1') {
					ui.msg(resp.msg, 1);
					ui.go(_ctx + '/registry/data_category_mgr.do');
				} else {
					ui.msg(resp.msg, 0);
				}
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			},
			error : function(resp) {
				ui.msg('请求发送失败', 0);
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			}
		});
	});
</script>
</head>
<body>
	<%@ include file="/WEB-INF/view/common/topbar.jsp"%>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<%@ include file="/WEB-INF/view/common/sidebar.jsp"%>
			<div class="main-content">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> <a href="#">首页</a></li>
						<li>
							<a href="#">注册管理</a>
						</li>
						<li><a href="#">数据分类</a></li>
						<li class="active">修改</li>
					</ul>
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<div class="widget-box">
								<div class="widget-header widget-header-flat">
									<div class="widget-toolbar no-border">
										<a class="btn btn-primary btn-xs"
											href="${ctx}/registry/data_category_mgr.do"><i
											class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
									</div>
								</div>
								<div class="widget-body">
									<div class="widget-main">
										<form class="form-horizontal" role="form" id="addNodeForm" action=""
											method="post">
											<input type="hidden"  id="dataCode" name="dataCode" value="${dc.dataCode }">
											<input type="hidden" id="id" name="id" value="${dc.id }">
											<input type="hidden" id="orgCode" name="orgCode" value="${dc.orgCode }">
											<input type="hidden" id="dcType" name="dcType" value="${dc.dcType }">
											<div class="space-4"></div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">数据分类名称 *</div>
												<div class="col-sm-9">
													<input type="text" class="col-xs-10 col-sm-5" name="dataName"
														id="dataName" datatype="require|limit|ajax"  min="2"  max="50"
														url="${ctx }/registry/is_dataName_unique.do" oldValue="${dc.dataName }"
														placeholder="请输入数据分类名称" value="${dc.dataName }"
														msg="请输入数据分类名称|数据分类名称长度错误，长度应为[2~50]！|数据分类名称重复！" title="必填项,数据分类名称" />
												</div>
											</div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">数据分类类型</div>
												<div class="col-sm-9" style="margin-top: 7px;">
													<span class="editable">${si:ctname("OBJECT_TYPE",dc.dcType)}&nbsp;</span>
												</div>
											</div>
											<div class="form-group">
											    <div class="col-sm-3 control-label no-padding-right">选择业务域 *</div>
											     <div class="col-sm-9" >
											    	<select class="col-sm-5"
												    	name="domainId" id="domainId"  datatype="require"
														msg="请选择业务域" title="必选项，业务域">
															<option value=''>-请选择-</option>
														  <c:forEach var="domain" items="${domainList}">
														  		<option <c:if test="${ dc.domainId eq domain.id}"> selected="selected" </c:if> value="${domain.id}" onclick="changeDomain('${domain.nodeName}','${domain.nodeCode}')">${domain.name}
														  	</option>
														  </c:forEach>
													</select>
											    </div>
											 </div>
											<div class="space-4"></div>
											<div class="space-4"></div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-2">自描述</div>
												<div class="col-sm-9">
													<textarea class="col-sm-10" placeholder="请输入自描述" name="selfDesc" 	id="selfDesc" title="自描述" rows="9" >${dc.selfDesc }</textarea>
												</div>
											</div>
											<div class="space-4"></div>
											<div class="form-group" style="display: none;">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-2">是否加密</div>
												<div class="col-sm-9">
													<input type="radio" name="encodeTls" id="encode_tls1"  value="1" class="ace" <c:if test="${ dc.encodeTls eq 1}"> checked="checked"</c:if>>
																		<span class="lbl">&nbsp;是</span> &nbsp;
													<input type="radio" name="encodeTls" id="encode_tls2"  value="0" class="ace"  <c:if test="${ dc.encodeTls eq 0}"> checked="checked"</c:if>>
																		<span class="lbl">&nbsp;否</span> &nbsp;
												</div>
											</div>
											<div class="space-4"></div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-2">备注</div>
												<div class="col-sm-9">
													<textarea class="col-sm-5" placeholder="请输入备注" name="remark"
														id="remark" title="备注">${dc.remark }</textarea>
												</div>
											</div>
											<hr>
											<div class="clearfix form-group">
												<div class="col-md-offset-3 col-md-9">
													<button type="submit" class="btn btn-sm btn-info"  id="sbmBtn"  >
														<i class="icon-ok bigger-110"></i>提交
													</button>
												</div>
											</div>
										</form>
										</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>